<template>
	<!-- 忘记密码 -->
	<!-- 密码重置 -->
	<!-- 弱国依然天天 -->
	<!-- 顶部固定位置 -->
	<view class="forget">
		<view class="titlesHead">
			<view class="iconfont icon-fangxiang-xiangzuo icon" @tap="yun"></view>
			<view class="titname"> </view>
			<view class="titRight"></view>
		</view>
		<view class="zhanwei">静安阿达</view>
		<!-- 重置密码提示 -->
		<view class="toushi"> 忘记了密码，可在此重置新密码 </view>
		<!-- 手机号 -->
		<view class="phone">
			<view class="picon">
				<!-- 	<image src="https://img0.baidu.com/it/u=2047586621,4226957915&fm=26&fmt=auto" mode=""></image> -->
			</view>
			<input type="password" name="password" placeholder="请输入电话号码" value="" />
		</view>
		<!-- 新密码 -->
		<view class="phone">
			<view class="picon">
				<!-- <image src="https://img0.baidu.com/it/u=2047586621,4226957915&fm=26&fmt=auto" mode=""></image> -->
			</view>
			<input type="password" name="username" placeholder="请输入新密码" v-model="username" />
		</view>

		<!-- 发送验证码 -->
		<view class="phone">
			<view class="picon">
				<!-- <image src="https://img0.baidu.com/it/u=2047586621,4226957915&fm=26&fmt=auto" mode=""></image> -->
			</view>
			<input type="password" name="password" placeholder="请输入验证码" value="" />
			<view class="yanzheng"> 发送验证码 </view>
		</view>
		<!-- 点击更新信息 -->
		<button type="default" class="butt" @click="gengxin">重置密码</button>
	</view>
</template>

<script>
	import { forgetPass } from "@/api/forgetPassword/fortgetPassword.js"
	export default {
		data() {
			return {
				username: ''
			};
		},
		methods: {
			// 返回上一页
			yun() {
				uni.navigateBack({
					delta: 1,
				});
			},
			// 重置密码
			gengxin() {
				forgetPass({
					username:this.username
				}).then(res=>{
					console.log(res)
				})
			}
		},
	};
</script>

<style lang="less" scoped>
	.forget {
		background-color: #f4e8ab;
		height: 100vh;
		position: relative;
		padding: 0 80rpx;

		// 头部固定位置
		.titlesHead {
			height: 100rpx;
			width: 100%;
			position: fixed;
			top: 0;
			left: 0;
			color: white;
			display: flex;
			align-items: center;
			background-color: #135a05;

			.icon {
				flex: 1;
				padding-left: 50rpx;
				box-sizing: border-box;
			}

			.titname {
				flex: 3;
				text-align: center;
			}

			.titRight {
				flex: 1;
			}
		}

		// 头部固定后面占位置的盒子，不要删除哈
		.zhanwei {
			width: 100%;
			height: 100rpx;
			background-color: #104d04;
		}

		// 提示
		.toushi {
			margin: 64rpx 0 40rpx 48rpx;
			color: #8d8d8d;
		}

		// 手机号
		.phone {
			width: 100%;
			height: 76rpx;
			border-radius: 30rpx;
			display: flex;
			align-items: center;
			justify-content: flex-start;
			margin-bottom: 40rpx;
			background-color: #dadcdb;

			.picon {
				width: 32rpx;
				height: 32rpx;
				margin: 0 30rpx;

				image {
					width: 100%;
					height: 100%;
				}
			}

			.yanzheng {
				width: 30%;
				height: 76rpx;
				border-radius: 30rpx;
				text-align: center;
				font-size: 20rpx;
				background-color: red;
				line-height: 76rpx;
			}
		}

		// 重置密码
		.butt {
			margin-top: 150rpx;
			border-radius: 50rpx;
			color: #ffffff;
			background-color: #354e44;
		}
	}
</style>
